package com.shuda.business.channel.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 下游渠道实体类
 */
@Data
@TableName("channel_downstream")
@Schema(name = "DownstreamChannelEntity", description = "下游渠道实体")
public class DownstreamChannelEntity {

    @TableId(type = IdType.AUTO)
    @Schema(description = "渠道ID")
    private Long id;

    @Schema(description = "渠道名称")
    private String channelName;

    @Schema(description = "渠道编码")
    private String channelCode;

    @Schema(description = "渠道类型(api-API推送,crm-租户CRM)")
    private String channelType;

    @Schema(description = "渠道状态(enabled-启用,disabled-禁用)")
    private String channelStatus;

    @Schema(description = "渠道描述")
    private String channelDesc;

    @Schema(description = "API密钥")
    private String apiKey;

    @Schema(description = "推送URL")
    private String pushUrl;

    @Schema(description = "接收URL")
    private String receiveUrl;

    @Schema(description = "白名单IP")
    private String whitelistIp;

    @Schema(description = "每日限额")
    private Integer dailyLimit;

    @Schema(description = "优先级")
    private Integer priority;

    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "逻辑删除标识(0-未删除,1-已删除)")
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;
}